﻿using DevExpress.XtraEditors.DXErrorProvider;
using ValidationEngine.Commons.Enums;

namespace ValidationEngine.Commons
{
    internal static class ExtendedMethods
    {
        #region String class extenders
        public static bool IsNullOrEmpty(this string str)
        {
            return null == str || str.Equals(string.Empty);
        } 
        #endregion

        public static ErrorType GetDXErrType(this ValidationErrorType errorType)
        {
            switch(errorType)
            {
                case ValidationErrorType.Error: 
                    return ErrorType.Default;
                case ValidationErrorType.Information: 
                    return ErrorType.Information;
                case ValidationErrorType.Warning: 
                    return ErrorType.Warning;
                default: 
                    return ErrorType.None;
            }

        }
    }
}
